home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1379_zombie_processes.rtf < prev    next >
Text File  |  1993-11-08  |  5KB  |  140 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
  2. \paperw11220
  3. \paperh7380
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red84\green84\blue84;\red83\green83\blue83;\red82\green82\blue82;\red81\green81\blue81;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q: Help!  My machine has slowed to molasses.  Even executing 
  8. \b ls
  9. \b0  in a terminal takes forever.  A 
  10. \b ps
  11. \b0  shows the process numbers in the PID table are in the thousands—even soon after reboot.  There are 3 defunct processes owned by root with priority of -1 which can't be killed.  When trying to launch memory hungry applications on my low memory (RAM memory) machine I get “insufficient memory” errors.  What can I do?\
  12.  
  13. \i     \
  14.  
  15. \i0 A:  The key symptom of this problem is the defunct or “zombie” processes shown in the PID table.  A zombie process occurs when a child process dies after its parent has died, and no 
  16. \b wait
  17. \b0 () has been done for the child.  Once the child process dies, it is inherited by 
  18. \b init
  19. \b0  and owned by 
  20. \b root
  21. \b0 .  These processes are 
  22. \i not
  23. \i0  consuming any system resources, except for one process table slot.  They are not using memory or CPU time because they are done executing and therefore cannot be killed.  When a UNIX system exhibits this type of problem (spawning lots of zombies) then some system process (often a getty) is trying to start, is failing, and is re-trying endlessly.\
  24. \
  25. Good places to look for causes of such problems are the following system files (all in 
  26. \b /etc
  27. \b0 ):\
  28. \
  29.  
  30. \f1\fs24\fc1\cf1     rc\
  31.     rc.boot\
  32.     rc.local\
  33.     rc.swap\
  34.     crontab\
  35.     ttys\
  36.     gettytab\
  37.  
  38. \f0\fs28\fc0\cf0 \
  39. Perform a checksum  (using 
  40. \b sum
  41. \b0 ) on the suspect file on your system and compare to the  checksum of the same file on your Software Release master.  A difference in the two numbers does not necessarily indicate an error—you might have intentionally changed something—but it does mean the file should be more closely scrutinized, especially if you don't think you've changed the file.\
  42. \
  43. For example, the first several lines of the /etc/ttys file on a stock, unmodified Release 1 through Release 3 disk looks like this:\
  44. \
  45.  
  46. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\fs24\li340\fc1\cf1 #\
  47. # name  getty                   type            status          comments\
  48. #\
  49. # If you do not want to start the window server by default, you can\
  50. # uncomment the first entry and comment out the second.\
  51. #\
  52. # console       "/usr/etc/getty std.9600"       NeXT            on secure\
  53. console /usr/lib/NextStep/loginwindow     NeXT            on secure window=/usr/lib/NextStep/WindowServer onoption="/usr/etc/getty std.9600"\
  54. ttya    "/usr/etc/getty std.9600"       unknown         off secure\
  55. ttyb    "/usr/etc/getty std.9600"       unknown         off secure\
  56. ttyda   "/usr/etc/getty D9600"          unknown         off\
  57. ttydb   "/usr/etc/getty D9600"          unknown         off\
  58. ttyp0   none                            network\
  59. ttyp1   none                            network\
  60.  
  61. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0\cf0 \
  62. The man page for 
  63. \b ttys
  64. \b0  explains that the flag 
  65. \b on
  66. \b0  and 
  67. \b off
  68. \b0  in the fourth column specify whether 
  69. \b init
  70. \b0  should execute the command given in the second field.  It's an error to specify 
  71. \b on
  72. \b0  if the second field contains 
  73. \b none
  74. \b0 .  The 
  75. \b secure
  76. \b0  further qualifies an 
  77. \b on
  78. \b0  to allow root to login to this line.  
  79. (See more about the “secure” flag below.)\
  80. \
  81. Specifying 
  82. \b on
  83. \b0  so that someone may log in over the network tty line causes the performance degradation described above.   The network entries should 
  84. \i never
  85. \i0  specify 
  86. \b on
  87. \b0 . In other words, an 
  88. \b /etc/ttys
  89. \b0  file which contains the following entries is an 
  90. \i error
  91. \i0 :\
  92. \
  93.  
  94. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\fs24\fc1\cf1 ttyp0   none                            network           on  secure\
  95. ttyp1   none                            network           on  secure\
  96. ttyp2   none                            network           on  secure\
  97.  
  98. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0\cf0 \
  99. If this is the case, either change the 
  100. \b on
  101. \b0  entry to 
  102. \b off
  103. \b0  and reboot, or  restore the file from a Release disk and reboot.  As an alternative to rebooting, after modifying the 
  104. \b ttys
  105. \b0  file, you can type in a Terminal as root:\
  106. \
  107.  
  108. \f1\fs24     rhino-22# 
  109. \b kill -HUP 1
  110. \f0\b0\fs28 \
  111. \
  112. This tells the 
  113. \b init
  114. \b0  process to reread the 
  115. \b ttys
  116. \b0  file.\
  117. \
  118.  
  119. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\b\fc1\cf1 Warning
  120. \b0 : specifying 
  121. \b off
  122. \b0  and 
  123. \b secure
  124. \b0  on ttyp0 (for example) is permissible but not advisable.  This would allow users to 
  125. \b rlogin
  126. \b0  or 
  127. \b telnet
  128. \b0  as root to the machine on pseudo port 0 and can present a security risk.  See Chapter 16, “Security,” in the Release 2 
  129. \i NeXT Network and System Administration
  130. \i0   or  Chapter 14, “Security,” in the Release 3 
  131. \i NeXTSTEP Network and System Administration 
  132. \i0 manual for more information on security in general.\
  133.  
  134. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0\cf0 \
  135. QA592\
  136. \
  137. Valid for 1.0, 2.0, 3.0, 3.1\
  138. \
  139.  
  140.